//
//  TMGSystemMessageTableViewCell.m
//  TMGold
//
//  Created by Mac on 2018/3/19.
//  Copyright © 2018年 tangmu. All rights reserved.
//

#import "TMGSystemMessageTableViewCell.h"
@interface  TMGSystemMessageTableViewCell()
@property(nonatomic, strong) STLabel                     *nameLable;
@property(nonatomic, strong) STLabel                     *timeLable;
@property(nonatomic, strong) STLabel                     *contentLable;
@end
@implementation TMGSystemMessageTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 80;
}
#pragma mark --subView
- (void)configSubView{
    
    self.backgroundColor = [UIColor clearColor];
    UIView * whiteView = [[UIView alloc] initWithFrame:CGRectMake(10, 5, UIScreenWidth - 20, [TMGSystemMessageTableViewCell cellHeight] - 10)];
    whiteView.backgroundColor = [UIColor whiteColor];
    whiteView.layer.cornerRadius = 4;
    whiteView.clipsToBounds = YES;
    [self addSubview:whiteView];
    
    
    self.nameLable = [[STLabel alloc] initWithFrame:CGRectMake(10, 0, 200, 40)
                                                     text:@"系统消息"
                                                textColor:FirstTextColor
                                                     font:16
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [whiteView addSubview:self.nameLable];
    
    
    self.timeLable = [[STLabel alloc] initWithFrame:CGRectMake(10, 0, whiteView.width, 40)
                                               text:@"2018年03月19日14:44:16"
                                          textColor:SecendTextColor
                                               font:16
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentRight];
    self.timeLable.right = whiteView.width - 10;
    [whiteView addSubview:self.timeLable];
    
    self.contentLable = [[STLabel alloc] initWithFrame:CGRectMake(10, self.nameLable.bottom, whiteView.width - 20, 20)
                                               text:@"测试大家深刻了解大陆"
                                          textColor:FirstTextColor
                                               font:16
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    [whiteView addSubview:self.contentLable];
    
}
- (void)setModel:(TMGSystemMessageModel *)model{
    _model = model;
    self.contentLable.text = model.content;
    self.timeLable.text = model.create_time;
}
@end
